<template>
<div style="width: 430px;height: 932px;">
  <van-nav-bar
    title=""
    left-text="返回"
    left-arrow
    @click-left="onClickLeft"
  />
  <van-tabs v-model="active">
      <van-list>
        <van-cell v-for="(item, index) in maintList" :key="index">
          <p>订单号：{{item.orderNumber}}</p>
          <p>维修方式：{{item.repairMethod}}</p>
          <p>报修问题1：{{item.repairIssue1}}</p>
          <p>报修问题2：{{item.repairIssue2}}</p>
          <p>描述：{{item.description}}</p>
          <p><van-button @click="toXQ(item.id)">查看详情</van-button></p>
        </van-cell>
      </van-list>
  </van-tabs>
</div>
</template>

<script>
import axios from "axios";

export default {
  data () {
    return {
      queueId:0,
      active: 0,
      maintList:[],
      form:{},
      user:{},
    }
  },
  methods: {
    onClickLeft() {
      this.$router.go(-1)
    },
    toXQ(id){
      this.queueId = id;
      this.$router.push({
        path: '/orderdetails',
        query: {
          id: this.queueId
        }
      })
      localStorage.setItem("queueId",this.queueId)
    },
    findmaint(){
      axios.post("/carorder/findCarOrderAll").then(res=>{
        this.maintList = res.data.data.list;
      })
    }
  },
  created() {
    this.findmaint();
    this.user = JSON.parse(localStorage.getItem('admin'));
    console.log(this.user.id)
  }
}
</script>

<style scoped>

</style>
